package com.google.api.chart;

import java.util.List;

import com.google.api.chart.encoding.JoinHelper;
import com.google.api.chart.features.FillAreaFeature;
import com.google.api.chart.features.LineStylesFeature;

public class LineStyleFillAreaFeatureHelper<T> implements FillAreaFeature<T>, LineStylesFeature<T>, ChartTypeMaker {
	
	private T outer;
	private String chm = null;
	private String chls = null;

	protected LineStyleFillAreaFeatureHelper(T outer) {
		this.outer = outer;
	}
	
	@Override
	public T fillAreas(FillAreaMaker... fills) {
		this.chm = JoinHelper.join(fills, "|");
		return outer;
	}
	
	public T linestyles(LineStyleMaker... linestyles) {
		this.chls = JoinHelper.join(linestyles, "|");
		return outer;
	}
	
	@Override
	public void fillParameters(List<String> parameters, List<String> chmParameters) {
		if (chm != null)
			chmParameters.add(chm);
		if (chls != null)
			parameters.add("chls=" + chls);
	}

}
